<script setup>
const props = defineProps({
  money: {
    type: Number
  }
})
const emits = defineEmits(['setMoney'])
function btnClick () {
  console.log(props.money)
  emits('setMoney', props.money - 5)
}
</script>

<template>
  <div class="son-page">
    我是子组件
    <h3>{{ money }}</h3>
    <button @click="btnClick">修改money</button>
  </div>
</template>

<style scoped>
.son-page {
  width: 300px;
  height: 300px;
  border: 5px solid red;
}
</style>
